package name.jautzy.esi.client;

import com.extjs.gxt.ui.client.event.ButtonEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.button.ToggleButton;

public class AboutListener implements Listener<ButtonEvent> {
private ContentPanel parent = null;
	
	public AboutListener (ContentPanel parent) {
		this.parent = parent;
	}
	
	public void handleEvent(ButtonEvent ce) {  
        if (!ce.<ToggleButton> getComponent().isPressed()) {  
          return;  
        }  
        
        
        ContentPanel panel = new ContentPanel();
        panel.setHeading("About");
        panel.setHeaderVisible(false);
        
        panel.setBodyStyle("background-color:black;"
        				  +"background-image:url(ressources/images/background/01_1024.jpg);"
        				  +"backgroung-repeat:no-repeat;"
        				  +"color:white;");
        
        panel.addText("<center><B>Copyright 2010, Olivier Jautzy </B></center> <br />");
       
        panel.addText("<center>This program is free software: you can redistribute it and/or modify"
        		     +" it under the terms of the GNU General Public License as published by"
        		     +" the Free Software Foundation, either version 3 of the License, or any later version.</center> <br />");
        panel.addText("<center>This program is distributed in the hope that it will be useful,"
   		             +" but WITHOUT ANY WARRANTY; without even the implied warranty of"
   		             +" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the"
   		             +" GNU General Public License for more details. </center> <br />");
        panel.addText("<center>A copy of the GNU General Public License can be find at "
        		     +"<a href=\"http://www.gnu.org/licenses/\" style=\"color:goldenrod\">http://www.gnu.org/licenses/</a></center> <br />");
        panel.addText("<center>The source code of this tool can be find at "
   		     +"<a href=\"http://code.google.com/p/eveshipidentity/\" style=\"color:goldenrod\">http://code.google.com/p/eveshipidentity/</a></center> <br />");
        		   
        panel.addText("<center>"+Esi.ccpCopyright+"</center>");

        
	    parent.removeAll();  
	    parent.add(panel);  
	    parent.layout();     
	}  
}
